{include file="common/header-top" /}

<style>
    .help-item-block{

    }
    .help-item-block .van-grid-item__content{
        background-color: #f9fcfa;
        padding: 4px 4px;
    }
    .help-item-block .van-grid-item__content .ven-cell{
        padding: 7px 15px;
    }
    .article {
        padding-left: 10px;
        padding-right: 10px;
        overflow: auto;
    }
    .article img {
        max-width: 100% !important;
    }
</style>


<div id='app' v-cloak>

    <van-nav-bar
            :title="newsDetail.title"
            left-arrow
            @click-right=""
            @click-left="goBack"
    >
        <van-icon
                name="/__FRONT__/images/icon/news-more.png"
                slot="right"
                @click="goNewsList"
                size="25"
        >
        </van-icon>
    </van-nav-bar>


    <!--资讯封面图片-->
    <van-row>
        <van-col span="24">
            <van-image
                :src="getNewsCover"
                width="98%"
                height="180px"
                fit="contain"
            ></van-image>
        </van-col>
    </van-row>
    <!--资讯封面图片-->


    <van-divider :style="{borderColor: '#32a14a', padding: '0px', margin: '0px'}"></van-divider>

    <van-row style="margin-bottom: 100px;">
        <van-col span="24">
            <section v-html="newsDetail.content" class="article">
            </section>
        </van-col>
    </van-row>





    {include file="common/foot-bar" /}

</div>





<script>
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                active:3,
                userCenterIcon: {
                    normal: '/__FRONT__/images/icon/usercenter-n.png',
                    active: '/__FRONT__/images/icon/usercenter-a.png'
                },
                erShouIcon: {
                    normal: '/__FRONT__/images/icon/ershou-n.png',
                    active: '/__FRONT__/images/icon/ershou-a.png'
                },


                newsId: '{$id}',
                newsDetail:{},

            }
        },

        created(){
            this.getNewsDetail();

        },

        computed:{
            getNewsCover(){
                if (this.newsDetail.cover) {
                    return this.newsDetail.cover;
                }
                return '/__FRONT__/images/icon/news-default-cover.png';
            },
        },

        methods:{

            //返回上一页
            goBack(){
                history.back();
            },


            getNewsDetail(){

                var params = {
                    id: this.newsId
                };

                axiosRequest.get('/api/news/detail',{params:params}).then(function (response) {
                    if (response.code == 200) {
                        vm.$data.newsDetail = response.data;
                    } else {
                        vant.Toast('系统开小差啦！');
                    }
                });
            },


            goNewsList(){
                window.location.href = '';
            },


        }
    });




</script>

{include file="common/foot-bottom" /}
